Skip to content

fix(api): repair voice notes and Veo requests#697

Merged
namastex888 merged 1 commit into
devfrom
luluzinha-main
Jun 2, 2026
Merged

fix(api): repair voice notes and Veo requests#697
namastex888 merged 1 commit into
devfrom
luluzinha-main

Conversation

@namastex888
Copy link
Copy Markdown
Contributor

Summary

  • send voice-note media through the WhatsApp audioBuffer path and normalize OGG voice-note MIME to audio/ogg; codecs=opus
  • stop sending unsupported Gemini Veo generateAudio config
  • add regression coverage for both paths

Verification

  • bun test packages/api/src/routes/v2/tests/messages-send-media.test.ts packages/api/src/providers/gemini/videogen.test.ts
  • bunx biome check packages/api/src/routes/v2/messages.ts packages/api/src/routes/v2/tests/messages-send-media.test.ts packages/api/src/providers/gemini/videogen.ts packages/api/src/providers/gemini/videogen.test.ts
  • bun run build
  • cd packages/cli && bun run build:server
  • omni restart
  • omni doctor: 13 OK, 0 WARN, 0 FAIL
  • live WhatsApp smoke: omni speak delivered as audio/ogg; codecs=opus; omni film generated 4s MP4 and send delivered

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 05ed404a-7b4d-4326-92ec-6652018984ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch luluzinha-main

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Gemini video generation provider to omit the generateAudio parameter, treating it as a compatibility no-op since the current Veo 3.1 API rejects it. Additionally, it refactors media sending routes to forward WhatsApp voice-note audio as an audioBuffer instead of base64 and normalizes the MIME type for OGG audio. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@namastex888 namastex888 merged commit 9504034 into dev Jun 2, 2026
10 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 455ca32c66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


function buildSendMediaMetadata(data: z.infer<typeof sendMediaSchema>): Record<string, unknown> {
if (data.type === 'audio' && data.voiceNote === true && data.base64) {
return { audioBuffer: Buffer.from(data.base64, 'base64'), ptt: true };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve base64 for voice-note conversion

When callers send a base64 voice note that is not already OGG/Opus (for example omni send --media clip.mp3 --voice, which posts base64), this replaces metadata.base64 with audioBuffer. The WhatsApp preprocessing path still only looks at message.content.mediaUrl or message.metadata?.base64 before calling convertBufferForVoiceNote (packages/channel-whatsapp/src/plugin.ts around processAudioForVoiceNote), so it now returns early and skips conversion, sending the original MP3/WAV buffer as ptt instead of a WhatsApp-compatible OGG/Opus voice note. Either keep the base64 through preprocessing or update the WhatsApp converter to consume audioBuffer.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants